package com.ruoyi.web.service;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.DemoOrderMapper;
import com.ruoyi.web.domain.DemoOrder;


/**
 * 订单Service业务层处理
 *
 * @author pei
 * @date 2024-06-02
 */
@Service
public class DemoOrderService
{
    @Autowired
    private DemoOrderMapper demoOrderMapper;

    /**
     * 查询订单
     *
     * @param oId 订单主键
     * @return 订单
     */

    public DemoOrder selectDemoOrderByOId(Long oId)
    {
        return demoOrderMapper.selectDemoOrderByOId(oId);
    }

    /**
     * 查询订单列表
     *
     * @param demoOrder 订单
     * @return 订单
     */

    public List<DemoOrder> selectDemoOrderList(DemoOrder demoOrder)
    {
        return demoOrderMapper.selectDemoOrderList(demoOrder);
    }

    /**
     * 新增订单
     *
     * @param demoOrder 订单
     * @return 结果
     */

    public int insertDemoOrder(DemoOrder demoOrder)
    {
        demoOrder.setCreateTime(DateUtils.getNowDate());
        return demoOrderMapper.insertDemoOrder(demoOrder);
    }

    /**
     * 修改订单
     *
     * @param demoOrder 订单
     * @return 结果
     */

    public int updateDemoOrder(DemoOrder demoOrder)
    {
        demoOrder.setUpdateTime(DateUtils.getNowDate());
        return demoOrderMapper.updateDemoOrder(demoOrder);
    }

    /**
     * 批量删除订单
     *
     * @param oIds 需要删除的订单主键
     * @return 结果
     */

    public int deleteDemoOrderByOIds(Long[] oIds)
    {
        return demoOrderMapper.deleteDemoOrderByOIds(oIds);
    }

    /**
     * 删除订单信息
     *
     * @param oId 订单主键
     * @return 结果
     */

    public int deleteDemoOrderByOId(Long oId)
    {
        return demoOrderMapper.deleteDemoOrderByOId(oId);
    }
}
